Add support for output_files#618
Merged
niknetniko merged 24 commits intofiles-featuresfrom Mar 5, 2026
Merged
Conversation
Member
Author
|
I can't seem to get Copilot to review this (maybe something with rights), so I'll leave it up to someone else to request it. |
TomNaessens
approved these changes
Mar 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements support for output_files in TESTed's test suite DSL (first part of issue #601). It extends the framework to allow multiple expected output files to be specified per test case, introduces conflict detection in the execution planner for both input and output files, and extracts the file oracle into its own module with multi-result support.
Changes:
- New
output_filesDSL key and refactoredFileOutputChannelto use afiles: list[TextData]instead of the oldexpected_path/actual_pathfields (with backward-compatible converters). - File oracle (
tested/oracles/file.py) extracted fromtext.py, now returning alist[OracleResult]to report one result per file;_evaluate_channelinevaluation.pyupdated to iterate over all results. - Planning algorithm enhanced to detect and split on output file conflicts (same output path across contexts) and input file conflicts (same input path with different content).
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tested/testsuite.py |
FileOutputChannel refactored to files: list[TextData]; get_input_files/get_output_files methods added to Context |
tested/oracles/file.py |
New file: extracted file oracle with multi-file support, returning list[OracleResult] |
tested/oracles/text.py |
Removed evaluate_file function (moved to file.py) |
tested/oracles/common.py |
Added channel_override field to OracleResult; updated Oracle/RawOracle types |
tested/oracles/__init__.py |
Updated routing to use file.evaluate_file |
tested/oracles/value.py |
Added FileOutputChannel handling in get_values for custom oracle use |
tested/judge/planning.py |
New input/output file conflict detection in _flattened_contexts_to_units |
tested/judge/evaluation.py |
Multi-result oracle support; _add_channel FileOutputChannel branch; link_files_message returns None when empty |
tested/dsl/translate_parser.py |
New output_files key handling; refactored _convert_file_output_channel to support list/dict/legacy formats |
tested/dsl/schema.json |
New output_files field, new fileDataFullyRequired definition, new format variants |
tested/dsl/schema-strict.json |
Same schema updates as schema.json |
tests/test_planning.py |
New comprehensive planning unit tests |
tests/test_planning_sorting.py |
Extended sorting/deduplication tests |
tests/test_oracles_builtin.py |
Updated file oracle tests for multi-result |
tests/test_oracles_programmed.py |
New custom oracle tests for output files |
tests/test_io_exercises.py |
New test_file_combinations integration test |
tests/test_dsl_legacy.py |
New DSL parsing tests for both legacy and new output_files formats |
tests/test_dsl_yaml.py |
Updated YAML DSL test assertions |
tests/test_file_linking.py |
Corrected assertion for link_files_message returning None |
tests/test_suite.py |
Updated FileOutputChannel deserialization assertions |
tests/test_testsuite_legacy.py |
Updated legacy deserialization assertions |
tests/exercises/time-2-code/* |
New exercise with input+output file combinations for all languages |
tests/exercises/output-files-custom-oracle/* |
New exercise for custom oracle with output files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the first part of #601, adding support for
output_files:This is a bit special as internally it introduces the concept of an evaluator that returns multiple "channels" from a single evaluator.
Additionally, this PR introduced changes to the planning of a test suite execution to better support files. Specifically, a new execution will be started for:
stdin, files are prepared before execution, we need a new execution to have the same files with different content.Note: the new file-related stuff is only available in the
tabs/contexts/testcasesnaming in the DSL, not in the alternative schema, as I didn't want to put in the effort of changing those.